#!/usr/bin/env node

const fs = require('fs')
const file = process.argv[2] ?? __filename;

fs.stat(file, (err, stats) => {
    if (err) {
      console.error('Error: File does not exist.');
      return;
    }
    if (stats.isDirectory()) {
      console.error('Error: Provided path is a directory.');
      return;
    }
});

fs.createReadStream(file).pipe(process.stdout);